Finding hp >100 and cyl=3
Title
Question
Following error is appearing on writing the command
mtcarshpcyl <- filter(mtcarshpcyl,cyl=3 & hp>100)
Error in filter(mtcarshpcyl, cyl = 3 & hp > 100) :
unused argument (cyl = 3 & hp > 100)
> View(mtcarshpcyl)
Error in View : object 'mtcarshpcyl' not found
R Data-Manipulation-using-dplyr-Package 12-13 min 0-10 sec
Answers:
You should modify your command, as given below:
mtcarshpcyl <- filter(mtcars, cyl == 4 & hp > 100)
Please note that the first argument inside the filter function is the name of the data frame, which is mtcars. The second argument is the values by which we want to filter the data frame.
Login to add comment